//
//  loginController.m
//  pmmSS
//
//  Created by Mac book on 2017/9/5.
//  Copyright © 2017年 WTFSSD. All rights reserved.
//

#import "loginController.h"
#import "BaseTabbarController.h"
#import "registerController.h"
#import "FWoneController.h"


@interface loginController ()

@property(nonatomic,strong)UILabel *registrationLabel,*forgetPasswordLabel;

@end

@implementation loginController

- (void)viewDidLoad {
    [super viewDidLoad];

    //自定义
    self.userLabel.text = @"帐号";
    self.passwordLabel.text = @"密码";
    self.userNameTextfield.placeholder = @"请输入您的手机号";
    self.passWordTextfield.placeholder = @"请输入密码";
    [self.loginBtn setTitle:@"登录" forState:UIControlStateNormal];


    //------------**********------------

    WeakSelf(weakSelf);

    _registrationLabel = [HMLabel createLabelWithText:@"注册" andTextColor:[UIColor whiteColor] andBgColor:nil andFont:[UIFont fontWithName:default_fontname size:autoScaleW(15)] andTextAlignment:NSTextAlignmentLeft];

    //设置可点击
    _registrationLabel.tag = 201;

    UITapGestureRecognizer *rec1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchLable:)];

    [_registrationLabel addGestureRecognizer:rec1];

    _registrationLabel.userInteractionEnabled=YES;

    [self.view addSubview:_registrationLabel];

    [_registrationLabel mas_makeConstraints:^(MASConstraintMaker *make) {

        make.left.mas_equalTo(10);
        make.top.equalTo(weakSelf.loginBtn.mas_bottom).offset(15);
        make.width.mas_equalTo(autoScaleW(35));
        make.height.mas_equalTo(autoScaleH(15));

    }];

    //------------**********------------


    _forgetPasswordLabel = [HMLabel createLabelWithText:@"忘记密码?" andTextColor:[UIColor whiteColor] andBgColor:nil andFont:[UIFont fontWithName:default_fontname size:autoScaleW(15)] andTextAlignment:NSTextAlignmentRight];


    _forgetPasswordLabel.tag = 202;

    UITapGestureRecognizer *rec2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchLable:)];


    [_forgetPasswordLabel addGestureRecognizer:rec2];
    _forgetPasswordLabel.userInteractionEnabled=YES;

    [self.view addSubview:_forgetPasswordLabel];

    [_forgetPasswordLabel mas_makeConstraints:^(MASConstraintMaker *make) {

        make.right.mas_equalTo(-10);
        make.top.equalTo(weakSelf.loginBtn.mas_bottom).offset(15);
        make.width.mas_equalTo(autoScaleW(75));
        make.height.mas_equalTo(autoScaleH(15));

    }];


}
-(void)clickBtn:(UIButton *)button{

    self.view.window.rootViewController = [[BaseTabbarController alloc] init];

}

-(void)touchLable:(UITapGestureRecognizer *)rec{

    switch (rec.view.tag) {
        case 201:
        {

           // NSLog(@"点击了%ld",(long)rec.view.tag);

            registerController *vc1 = [[registerController alloc]init];

            [self presentViewController:vc1 animated:YES completion:nil];
            
        }
            break;
            
        case 202:
        {
            //NSLog(@"点击了%ld",(long)rec.view.tag);

            FWoneController *vc2 = [[FWoneController alloc]init];

            [self presentViewController:vc2 animated:YES completion:nil];
            
        }
            break;
            
        default:
            break;
    }
    
   // NSLog(@"点击了%ld",(long)rec.view.tag);
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
